/**
 * @Author: likang xie
 * @Date: 2019-11-06 17:38:23
 * @Usage 同步修改State
 */

import * as types from "./types";

export default {
	
	[types.SET_CITY](state, data) {
		state.city = data;
	},
	
	// 设置用户信息
	[types.SET_USER_INFO](state, data) {
		state.userInfo = data;
		uni.setStorageSync("userInfo", data);
	},

	// 设置分类列表
	[types.SET_CLASSIFYS](state, data) {
		state.classifys = data;
		uni.setStorageSync("classifys", data);
	},

	// 设置当前选中分类列表
	[types.SET_CURRENT_CLASSIFYS](state, data) {
		state.currentClassifys = data;
		uni.setStorageSync("currentClassifys", data);
	},

	// 设置当前选中分类列表
	[types.SET_CURRENT_SERVICES](state, data) {
		state.currentServices = data;
		uni.setStorageSync("currentServices", data);
	},

	// 设置IOS的样式模式
	[types.SET_IOS_UI_STYLE](state, data) {
		state.iosUIStyle = data;
		uni.setStorageSync("iosUIStyle", data);
	},

	// 设置腾讯IM实例
	[types.SET_TIM](state, data) {
		state.tim = data;
	}
};
